package com.wms.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wms.entity.SysLog;
import com.wms.entity.SysLogDTO;
import com.wms.service.SysLogService;
import com.wms.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ---Do First---
 *
 * @author:wellseasun
 * @date:2025/5/4 上午 9:28
 * @desc:
 */
@RestController
@RequestMapping("/sysLog")
public class SySLogController {
    @Autowired
    private SysLogService sysLogService;

    @GetMapping("/list")
    public R list(SysLogDTO sysLogDTO) {
        PageHelper pageHelper = new PageHelper();
        pageHelper.startPage(sysLogDTO.getPageNum(),sysLogDTO.getPageSize());
        List<SysLog> list = sysLogService.list(sysLogDTO);
        PageInfo<SysLog> pageInfo = new PageInfo<>(list);
        return R.ok(pageInfo);
    }
}
